package com.recommended.controller;

import com.recommended.dto.BaseSearchCondition;
import com.recommended.dto.DataInfoSearchCondition;
import com.recommended.dto.ReturnResult;
import com.recommended.service.DataSearchService;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.web.bind.annotation.*;

/**
 * @author xwj
 * @date 2019/4/8
 */
@RestController
@RequestMapping(path = "/data")
public class DataSearchController {
    @Autowired
    private DataSearchService dataSearchService;

    @PostMapping("/search")
    public ReturnResult search(DataInfoSearchCondition dataInfoSearchCondition) {
        return ReturnResult.successResult(dataSearchService.search(dataInfoSearchCondition));
    }

    @PostMapping("/searchProfessional")
    public ReturnResult searchProfessional(BaseSearchCondition baseSearchCondition) {
        return ReturnResult.successResult(dataSearchService.searchProfessional(baseSearchCondition));
    }

    @PostMapping("/searchUniversity")
    public ReturnResult searchUniversity(BaseSearchCondition baseSearchCondition) {
        return ReturnResult.successResult(dataSearchService.searchUniversity(baseSearchCondition));
    }
}
